<?php
/**
 * welcome developer.
 * author: liangbo
 * company:tencent suzhou
 * contact:173120209
 * mobile:18550451730
 * Date: 2016-12-18
 * Time: 4:50
 */

class Model extends database
{
    protected $_model;
    protected $_table;

    function __construct()
    {
        // 连接数据库
        parent::__construct(array(
            'database_type' => DB_TYPE,
            'database_name' => DB_NAME,
            'server' => DB_HOST,
            'username' => DB_USER,
            'password' => DB_PASSWORD,
            'charset' => DB_CHARAST,
            'prefix'=>prefix));

        // 获取模型名称
        $this->_model = get_class($this);
        $this->_model = rtrim($this->_model, 'Model');

        // 数据库表名与类名一致
        $this->_table = strtolower($this->_model);
      /*  define($this->_table, '(new '.$this->_model.')');*/
    }

    function __destruct()
    {
    }
/*    function select($join, $columns = null, $where = null)
    {


     return parent::select($this->_table,$join, $columns = null, $where = null);


    }*/
}